class EfEntityReferenceFormatter extends EfFieldFormatter

Provides formatting methods for taxonomy_term_reference, field_collection and entityreference field types.

Methods

__construct(EntityMetadataWrapper $property, bool $isMultivalue)

Constructor.

array|string
value()

Returns the current field item as a raw array.

array
values()

Returns all raw field items in an array.

all()

Returns an array of all field items as EfFieldFormatter objects.

array
setDelta($delta)

Set the current field delta.

bool
isDeltaValid(null $delta = NULL)

Checks if the given or current field delta exists.

bool
notEmpty()

Shortcut for the possible not so easy to understand isDeltaValid() method.

bool
isAccessible()

Check if current user is allowed to view this field.

getIterator()

Implementing IteratorAggregate interface.

int
count()

Implementing Countable interface.

$this
setViewMode($viewMode)

Sets the view mode which is used to render this entity.

getFormatter()

Returns a EfEntityFormatter for the specific entity type and bundle to access single fields on this entity.

bool
entityIsAccessible(string $op = 'view')

Checks if current user has access to the referenced entity.

string
render()

Renders an entity using the set view mode.

string
path()

Returns the path to the detail page of this entity.

string
url(array $options = array())

Returns an URL to the detail page of this entity.

string
label()

Returns the label of this entity.

string
linkedLabel()

Returns the node title wrapped in a link to the detail page of this entity.

__toString()

No description

Details

at line 580
__construct(EntityMetadataWrapper $property, bool $isMultivalue)

Constructor.

Parameters

EntityMetadataWrapper $property The value of this field wrapped by an EntityMetadataWrapper.
bool $isMultivalue Whether this field has a cardinality greater than one.

in EfFieldFormatter at line 43
array|string value()

Returns the current field item as a raw array.

Return Value

array|string

in EfFieldFormatter at line 52
array values()

Returns all raw field items in an array.

Return Value

array

in EfFieldFormatter at line 61
EfFieldFormatter[] all()

Returns an array of all field items as EfFieldFormatter objects.

Return Value

EfFieldFormatter[]

in EfFieldFormatter at line 74
array setDelta($delta)

Set the current field delta.

Parameters

$delta

Return Value

array

in EfFieldFormatter at line 91
bool isDeltaValid(null $delta = NULL)

Checks if the given or current field delta exists.

Parameters

null $delta

Return Value

bool

in EfFieldFormatter at line 102
bool notEmpty()

Shortcut for the possible not so easy to understand isDeltaValid() method.

Return Value

bool

in EfFieldFormatter at line 113
bool isAccessible()

Check if current user is allowed to view this field.

Can be needed if a module like field_permissions is in use.

Return Value

bool True, if current user is allowed to view this field.

in EfFieldFormatter at line 124
EfFieldFormatterIterator getIterator()

Implementing IteratorAggregate interface.

If we wrap a list, we return an iterator over the data list.

in EfFieldFormatter at line 133
int count()

Implementing Countable interface.

Return Value

int The number of items of this field.

at line 598
$this setViewMode($viewMode)

Sets the view mode which is used to render this entity.

Parameters

$viewMode

Return Value

$this

at line 608
EfEntityFormatter getFormatter()

Returns a EfEntityFormatter for the specific entity type and bundle to access single fields on this entity.

Return Value

EfEntityFormatter

at line 635
bool entityIsAccessible(string $op = 'view')

Checks if current user has access to the referenced entity.

Parameters

string $op The operation to check access for. One of 'view', 'update', 'create' or 'delete'.

Return Value

bool

at line 648
string render()

Renders an entity using the set view mode.

Return Value

string

at line 662
string path()

Returns the path to the detail page of this entity.

Return Value

string

at line 677
string url(array $options = array())

Returns an URL to the detail page of this entity.

Parameters

array $options

Return Value

string

at line 693
string label()

Returns the label of this entity.

Return Value

string

at line 707
string linkedLabel()

Returns the node title wrapped in a link to the detail page of this entity.

Return Value

string

at line 716
__toString()